<!DOCTYPE html>
<?php session_start(); ?>
<html>
<head>
	<title>Regist</title>
	<meta charset="UTF-8" />
</head>
<body>
                <?php
	$matchname = $_POST["username"];
	$password = $_POST["password"];
	$DB = mysql_connect("localhost","root","12345");
	mysql_query("set names utf8");
	mysql_select_db("mynotes",$DB);
                  $query = "insert into user value('".$matchname."','".md5($password)."',"."'Normal');";
	$DBT = mysql_query($query);
	if($DBT == true)
	{
            ?>
            <h1>注册成功，即将跳转</h1>
            <?php
            $_SESSION["session_username"] = $matchname;
            header("Refresh:3;url='index.php'");
            }
            else
                {
                	// die("wrong");
            ?>
                <h1>注册出错，即将跳转重新注册</h1>
                <?php
                header("Refresh:3;url='RegisterSite.php'");
                }
                ?>
</body>
</html>